home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
050
/
madtrb13.arc
/
PRTEST.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-05-26
|
1KB
|
48 lines
{ Turbo Pascal routines to read printer status }
{ by Michael D Bates 614-446-8203 }
{ c_Care, Inc. Health Management Software
Drawer 407
Gallipolis OH 45631 }
Function PrTest( WhichPrt : integer ) : boolean;
Type
regtype = Record
ax,bx,cx,dx,bp,si,di,ds,es,flags: integer
End;
var reg: regtype;
i: integer;
begin
reg.ax:=$0200;
reg.dx:=WhichPrt and $0002; { Don't Allow Greater than 2 }
intr($17,reg); { 0 = 1st Ptr, 1 = 2nd Ptr }
i := ((reg.ax and $ff00) shr 8);
{ prtest returns 8 Printer Deselected
40 Out of Paper
136 Printer of line
144 All OK
Bit Test is
0 = Timeout
1,2 = Unused
3 = I/O Error
4 = Selected
5 = Out of Paper
6 = Acknowledge
7 = Not Busy }
if (i = 144) then PrTest := True
else PrTest := False;
end;
{ Sample -- Delete for Function }
Begin
if PrTest(0) then Writeln('Printer is ready to Print')
else Writeln('Printer is not ready to Print');
End.